package com.krediti.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.validator.NotNull;

@Entity
@Table(name = "STATUSZAHTEVA")
public class StatusZahteva implements java.io.Serializable {

	/**
	 * Generated serial version.
	 */
	private static final long serialVersionUID = -4477107221203569049L;
	private Integer id;
	private String datum;
	private KreditniZahtev kreditniZahtev;
	private Status status;

	public StatusZahteva() {
	}

	public StatusZahteva(Integer id) {
		this.id = id;

	}

	public StatusZahteva(Integer id, String datum,
			KreditniZahtev kreditniZahtev, Status status) {
		this.id = id;
		this.datum = datum;
		this.kreditniZahtev = kreditniZahtev;
		this.status = status;

	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "STATUSZAHTEVA_SEQ")
	@SequenceGenerator(name = "STATUSZAHTEVA_SEQ", sequenceName = "STATUSZAHTEVA_SEQ")
	@Column(name = "ID")
	@NotNull
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "DATUM")
	@NotNull
	public String getDatum() {
		return datum;
	}

	public void setDatum(String datum) {
		this.datum = datum;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "KREDITNIZAHTEVID")
	public KreditniZahtev getKreditniZahtev() {
		return kreditniZahtev;
	}

	public void setKreditniZahtev(KreditniZahtev kreditniZahtev) {
		this.kreditniZahtev = kreditniZahtev;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STATUSID")
	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

}
